package com.atstudy.headline.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 内容审核记录表
 * @TableName content_reviews
 */
@TableName(value ="content_reviews")
@Data
public class ContentReviews {
    /**
     * 审核记录ID
     */
    @TableId(type = IdType.AUTO)
    private Integer reviewId;

    /**
     * 内容ID
     */
    private Integer contentId;

    /**
     * 审核人员ID
     */
    private Integer reviewerId;

    /**
     * 审核状态（1:待审核，2:通过，3:拒绝）
     */
    private Integer reviewStatus;

    /**
     * 审核时间
     */
    private Date reviewTime;

    /**
     * 审核意见
     */
    private String reviewComments;

    /**
     * 审核原因编码
     */
    private Integer reviewReasonCode;

    /**
     * 审核原因类型
     */
    private String reviewReasonType;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private Contents content;

    @TableField(exist = false)
    private Users reviewer;

    @TableField(exist = false)
    private BaseDicts reviewReason;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ContentReviews other = (ContentReviews) that;
        return (this.getReviewId() == null ? other.getReviewId() == null : this.getReviewId().equals(other.getReviewId()))
            && (this.getContentId() == null ? other.getContentId() == null : this.getContentId().equals(other.getContentId()))
            && (this.getReviewerId() == null ? other.getReviewerId() == null : this.getReviewerId().equals(other.getReviewerId()))
            && (this.getReviewStatus() == null ? other.getReviewStatus() == null : this.getReviewStatus().equals(other.getReviewStatus()))
            && (this.getReviewTime() == null ? other.getReviewTime() == null : this.getReviewTime().equals(other.getReviewTime()))
            && (this.getReviewComments() == null ? other.getReviewComments() == null : this.getReviewComments().equals(other.getReviewComments()))
            && (this.getReviewReasonCode() == null ? other.getReviewReasonCode() == null : this.getReviewReasonCode().equals(other.getReviewReasonCode()))
            && (this.getReviewReasonType() == null ? other.getReviewReasonType() == null : this.getReviewReasonType().equals(other.getReviewReasonType()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getReviewId() == null) ? 0 : getReviewId().hashCode());
        result = prime * result + ((getContentId() == null) ? 0 : getContentId().hashCode());
        result = prime * result + ((getReviewerId() == null) ? 0 : getReviewerId().hashCode());
        result = prime * result + ((getReviewStatus() == null) ? 0 : getReviewStatus().hashCode());
        result = prime * result + ((getReviewTime() == null) ? 0 : getReviewTime().hashCode());
        result = prime * result + ((getReviewComments() == null) ? 0 : getReviewComments().hashCode());
        result = prime * result + ((getReviewReasonCode() == null) ? 0 : getReviewReasonCode().hashCode());
        result = prime * result + ((getReviewReasonType() == null) ? 0 : getReviewReasonType().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", reviewId=").append(reviewId);
        sb.append(", contentId=").append(contentId);
        sb.append(", reviewerId=").append(reviewerId);
        sb.append(", reviewStatus=").append(reviewStatus);
        sb.append(", reviewTime=").append(reviewTime);
        sb.append(", reviewComments=").append(reviewComments);
        sb.append(", reviewReasonCode=").append(reviewReasonCode);
        sb.append(", reviewReasonType=").append(reviewReasonType);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}